print('Itools Version T-0.0.0')
import os
import easygui as e
class Commandline_tools:
    def safe_import(pack_name):
        try:
            a=__import__(pack_name)
        except:
            return None
        else:
            return a
    def status_command(command):
        sc=os.system(command)
        print('cmd.exe 已退出，状态码为',sc)
        return sc
class easygui_Tools:
    def pip_manager():
        a=e.choicebox(msg='请选择功能：',title='Itools:PIP manager',choices=['安装','升级','卸载','设置源'])
        if a=='安装':
            cmd='@echo off&echo Itools:PIP manager(安装)&pip install '
            a=e.enterbox(msg='请输入库名：',title='Itools:PIP manager(install)')
            cmd += a
            sc=os.system(cmd)
            print('cmd.exe 已退出,状态码:',sc)
        elif a=='升级':
            cmd='@echo off&echo Itools:PIP manager(升级)&pip install --upgrade '
            a=e.enterbox(msg='请输入库名：',title='Itools:PIP manager(upgrade)')
            cmd += a
            sc=os.system(cmd)
            print('cmd.exe 已退出,状态码:',sc)
        else:
            print('作者懒，暂时没弄...')
